EXE=a.out
OBJS:=${patsubst %.cpp,%.o,${wildcard src/*.cpp} main.cpp}
CXX=g++
CXXFLAGS=-Iinc
BUILD_DIR=build
OBJS:=${patsubst %.cpp,%.o,${wildcard src/*.cpp} main.cpp}

all:${EXE}
	mkdir ${BUILD_DIR}
	mv ${OBJS} ${BUILD_DIR}

${EXE}:${OBJS}
	${CXX} $^ -o $@

%.o:%.cpp
	${CXX} -c $^ -o $@ ${CXXFLAGS}
	
clean:
	rm -rf ${EXE} ${OBJS} ${BUILD_DIR}